home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / 3D Buttons CDEF 1.0b6 / 3D Buttons Read Me < prev   
Text File  |  1994-12-28  |  5KB  |  84 lines

  1. 3D Buttons, by Zig Zichterman
  2. 1.0b6 28 December 1994
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12. 3D Buttons is a control definition (CDEF) that implements the 3D interface as suggested in develop issue 15. When drawing on a 8-bit (or deeper) color device (in a color GrafPort), 3D Buttons draws in grey. 3D Buttons drops to normal 2D drawing for black and white (or less than 8 bits of color).
  13.  
  14. Read “Working in the Third Dimension” in develop issue 15. Jamie Osborne and Deanna Thomas tell all about the design and code for a three dimensional Macintosh, including 3D Buttons.
  15.  
  16. Just drop the CDEF into any application you write, under whatever id you like. Read Inside Macintosh if you need help specifying a CDEF in your controls.
  17.  
  18. I do not recommend using 3D Buttons as id 0—it overrides the system CDEF and Bad Things will probably happen. 3D Buttons certainly look goofy in Standard File dialogs.
  19.  
  20. Demo
  21. The demo application is a quick modal dialog that shows off most features I put into 3D buttons. Yes, I go against my own advice and use 3D Buttons as CDEF id 0 in this application.
  22.  
  23. The window background is grey with red, green, and blue set to 0xEEEE. 0xEEEE is the shade of grey suggested in develop 15.
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. Icon Buttons
  32. I defined icon buttons as proc id 3. (push buttons = 0, check boxes = 1, radio buttons = 2, and now, by decree-o-Zig, icon buttons = 3). Your control rect should be at least 40 pixels square for large icons, 24 pixels square for small icons. Non-square buttons will use a small or large icon, depending on what fits. Set the value of the control to the icon ID. Icon buttons do not draw titles.
  33.  
  34. Important note to users of 3D Buttons 1.0b5 and earlier
  35. The proc id for icon buttons has changed. It is now 3 instead of 4. I needed 4 as a flag (see "Indenting Buttons: below).
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45. Tristate Buttons
  46. 3D Buttons also implements tristate checkboxes and radio buttons. Set the control value to 2 to tristate it using Apple's standard. Set the control to 3 to tristate it using the Microsoft "light grey fill" standard.
  47.  
  48. Indenting Buttons
  49. If you set bit 2 (mask 0x04) in the control's proc id, push buttons and icon buttons will "indent" the title or icon when highlighted, so that it looks like you've actually pushed the button in. The title or icon draws down and to the right by one pixel.
  50. Add this mask (0x04) to proc ids the same way you add useWFont (0x08). For example, if you wanted a pushbutton that uses the window font, you would use pushButProc(0) + useWFont(8) = 8. If you want a pushbutton that indents the title when you push it, use pushButProc(0) + useWFont(8) + indentHighlighted(4) = 12.
  51. Although this is not part of the interface described in develop issue 15, this is a very common request and one that I felt was worth adding as an option.
  52.  
  53. Public Domain
  54. The 3D Buttons CDEF (source and object) is in the public domain. Use it in your apps. Don't pay a cent. Strip away any mention of Zig. There's nothing I can (or will) do. It's public domain code. 
  55.  
  56. Where to Find Zig
  57. ziggr@aol.com
  58. If you find any bugs in 3D Buttons, let me know and I just might fix them. I maintain a list of 3D Button users who want to be on a mailing list to receive updates. Write and I'll add you to the list.
  59.  
  60. I love to hear when someone actually uses the CDEF in a project. It makes all this work worthwhile.
  61.  
  62. Change History
  63. 1.0b6--28 December 1994
  64. Completely rewritten using more C++ features
  65. Removed Macsbug labels for smaller CDEF (now 15K)
  66. Changed iconButton procID from 4 to 3 to make room for indentHighlighted flag
  67. Added indentHighlighted flag (0x04) for pushButton and iconButton
  68. 1.0b5--06 December 1994
  69. Fix useWFont bug—now actually uses window's font.
  70. Save and restore font, pen color, pen state, and clip region across draw.
  71. Clip to intersection of original clip region and device when walking device list.
  72. Honor control and window auxilliary color tables ('cctb', 'wctb' and so on) when drawing inactive/flat controls, background of checkboxes and radio buttons.
  73. Don't force 4 corners of pushbuttons to 0xDDDD.
  74. 1.0b4--31 July 1994
  75. Save and restore pen color across draw. Draw 3D effects on 4-bit greyscale monitors.
  76. 1.0b3--28 July 1994
  77. Added offscreen GWorld support so the button titles would stop that annoying flashing. Many thanks to one of my users for pointing it out.
  78. 1.0b2--20 July 1994 (never released)
  79. Fixed a minor bug in the CDEF that would draw with a fat pensize (2,2) when it really wanted (1,1).
  80. Added a call to InitCursor() to make sure that the demo program doesn’t show a watch cursor while in the dialog.
  81. 1.0b1
  82. First public release.
  83.  
  84.